#include "gui/panel.h"

Panel::Panel(int direction){
    if(direction == FORM){
        layout = std::unique_ptr<FormLayout>(new FormLayout());
    }
    else{
        layout = std::unique_ptr<Layout>(new Layout(HORIZONTAL));
    }
}

void Panel::AddChild(std::unique_ptr<Widget> child){
    Widget::AddChild(std::move(child));
    layout->Arrange(this);
}
